/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.khleuven.screencasting.entiteiten;

import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wouterrombaut
 */
@Entity
public class Viewed implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @ManyToOne
    private Persoon persoon;
    @OneToOne
    private Screencast screencast;
    @Temporal(TemporalType.TIMESTAMP)
    private Calendar tijdstip;
    @Temporal(TemporalType.TIME)
    private Calendar duur;
    private int score_multiplechoice;
    private int score_openvragen;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Calendar getDuur() {
        return duur;
    }

    public void setDuur(Calendar duur) {
        this.duur = duur;
    }

    public Persoon getPersoon() {
        return persoon;
    }

    public void setPersoon(Persoon persoon) {
        this.persoon = persoon;
    }

    public int getScore_multiplechoice() {
        return score_multiplechoice;
    }

    public void setScore_multiplechoice(int score_multiplechoice) {
        this.score_multiplechoice = score_multiplechoice;
    }

    public int getScore_openvragen() {
        return score_openvragen;
    }

    public void setScore_openvragen(int score_openvragen) {
        this.score_openvragen = score_openvragen;
    }

    public Screencast getScreencast() {
        return screencast;
    }

    public void setScreencast(Screencast screencast) {
        this.screencast = screencast;
    }

    public Calendar getTijdstip() {
        return tijdstip;
    }

    public void setTijdstip(Calendar tijdstip) {
        this.tijdstip = tijdstip;
    }




    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Viewed)) {
            return false;
        }
        Viewed other = (Viewed) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entiteiten.View[id=" + id + "]";
    }

}